<?php
require_once('../model/conn.php');
header('Content-Type: application/json');
$oldmm = isset($_POST['oldmm']) ? $_POST['oldmm'] : null;
if ($oldmm === null) {
  echo json_encode(['code' => 500, 'msg' => '请求失败']);
  exit;
}
$sql = "select * from tbl_user where uName = '$_COOKIE[user]';";
$upass = exec_select($sql)[0]['uPass'];
if ($oldmm === $upass) {
  echo json_encode(['code' => 200, 'msg' => '密码相同']);
} else {
  echo json_encode(['code' => 500, 'msg' => '当前密码不正确！']);
}
?>